<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
</body>
<script>
    //所有的实例化对象都可以访问构造函数Object的原型对象

    function Cat(name, col) {
        this.name = name
        this.col = col
    }
    Cat.prototype.say = function () {
        console.log('喵喵')
    }
    Cat.prototype.want = function () {
        console.log('抓老鼠')
    }

    Object.prototype.a = 'abc'
    Object.prototype.b = 123
    var tom = new Cat('Tom', 'pink')

    console.log(tom.a, tom.b)
    console.log('Cat.prototype', Cat.prototype)
    console.log('Object.prototype', Object.prototype)



    // 老版本
    console.log(Cat.prototype.__proto__ === Object.prototype)  // true
    // 新版本
    console.log(Object.getPrototypeOf(Cat.prototype) === Object.prototype) // true

    // 官方强制规定
    // Object.prototype[[Prototype]] = null;  //后面不在向后查找

</script>

</html>